﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace EzDeploy
{
    class LocalizedStrings
    {
        static public event EventHandler ShowStatusMessageHandler;
        static public void ShowStatusMessage(string message)
        {
            ShowStatusMessageHandler(message, EventArgs.Empty);
        }

        #region Localized string
        static public string 
            str_connecting, 
            str_device, 
            str_operationwillstop, 
            str_dropxapfile, 
            str_nooperation,
            str_installed, 
            str_zunepathnotdefine, 
            str_wpcpathsaved,
            str_installing, 
            str_selectxapfile, 
            str_appnotinstalled,
            str_updated, 
            str_about,
            str_updating,
            str_waitForOperationDone, 
            str_failedinconnecting,
            str_notinstalled, 
            str_notupdated, 
            str_uninstalling, 
            str_uninstalled,
            str_notuninstalled,
            str_Error, str_cause, 
            str_connectingviawpc, 
            str_wpconnectwontlaunch, 
            str_wpconnectnotconnected,
            str_wpconnectconnected,
            str_waitingforwpc, 
            str_launchingwpc, 
            str_wpconnectpathnotdefine,
            str_operationstopped, 
            str_usingapp, 
            str_installfailed, 
            str_notconnect,
            str_ConnectedAndGettingInfo, 
            str_ConnectionExisted, 
            str_ConnectedSuccessfullly,
            str_NoDeviceConnected, 
            str_ChooseAXapFile, 
            str_ResumeHint, 
            str_InSettingHint, 
            str_SaveAsDone, 
            str_ZuneIsRunning, 
            str_ZunePathSaved, 
            str_Disconnecting,
            str_LaunchingFailed, 
            str_UnistalingFailed, 
            str_UseWpOrZune, 
            str_UnlockScreen, 
            str_Disconnected, 
            str_AlreadyDisconnected,
            str_WillDisconnect;

        #endregion

        static public void LoadLocalizedString()
        {
            try
            {
                str_WillDisconnect = (string)Application.Current.FindResource("str_WillDisconnect");
                str_AlreadyDisconnected = (string)Application.Current.FindResource("str_AlreadyDisconnected");
                str_Disconnected = (string)Application.Current.FindResource("str_Disconnected");
                str_UnlockScreen = (string)Application.Current.FindResource("str_UnlockScreen"); 
                str_UseWpOrZune = (string)Application.Current.FindResource("str_UseWpOrZune"); 
                str_UnistalingFailed= (string)Application.Current.FindResource("str_UnistalingFailed"); 
                str_LaunchingFailed = (string)Application.Current.FindResource("str_LaunchingFailed"); 
                str_Disconnecting = (string)Application.Current.FindResource("str_Disconnecting"); 
                str_ZunePathSaved = (string)Application.Current.FindResource("str_ZunePathSaved"); 
                str_ZuneIsRunning = (string)Application.Current.FindResource("str_ZuneIsRunning"); 
                str_SaveAsDone = (string)Application.Current.FindResource("str_SaveAsDone"); 
                str_InSettingHint = (string)Application.Current.FindResource("str_InSettingHint"); 
                str_ResumeHint = (string)Application.Current.FindResource("str_ResumeHint"); 
                str_ChooseAXapFile = (string)Application.Current.FindResource("str_ChooseAXapFile"); 
                str_Error = (string)Application.Current.FindResource("str_Error"); 
                str_NoDeviceConnected = (string)Application.Current.FindResource("str_NoDeviceConnected"); 
                str_ConnectedSuccessfullly = (string)Application.Current.FindResource("str_ConnectedSuccessfullly"); 
                str_ConnectionExisted = (string)Application.Current.FindResource("str_ConnectionExisted"); 
                str_ConnectedAndGettingInfo = (string)Application.Current.FindResource("str_ConnectedAndGettingInfo"); 
                str_about = (string)Application.Current.FindResource("str_About");
                str_appnotinstalled = (string)Application.Current.FindResource("str_Appnotinstalled");
                str_selectxapfile = (string)Application.Current.FindResource("str_Selectxapfile");
                str_wpcpathsaved = (string)Application.Current.FindResource("str_Wpcpathsaved");
                str_zunepathnotdefine = (string)Application.Current.FindResource("str_Zunepathnotdefine");
                str_nooperation = (string)Application.Current.FindResource("str_Nooperation");
                str_dropxapfile = (string)Application.Current.FindResource("str_Dropxapfile");
                str_operationwillstop = (string)Application.Current.FindResource("str_Operationwillstop");
                str_device = (string)Application.Current.FindResource("str_Device");
                str_installing = (string)Application.Current.FindResource("str_Installing");
                str_connecting = (string)Application.Current.FindResource("str_Connecting");
                str_installed = (string)Application.Current.FindResource("str_Installed");
                str_updated = (string)Application.Current.FindResource("str_Updated");
                str_updating = (string)Application.Current.FindResource("str_Updating");
                str_waitForOperationDone = (string)Application.Current.FindResource("str_WaitForOperationDone");
                str_failedinconnecting = (string)Application.Current.FindResource("str_Failedinconnecting");
                str_notinstalled = (string)Application.Current.FindResource("str_Notinstalled");
                str_notupdated = (string)Application.Current.FindResource("str_Notupdated");
                str_uninstalling = (string)Application.Current.FindResource("str_Uninstalling");
                str_uninstalled = (string)Application.Current.FindResource("str_Uninstalled");
                str_notuninstalled = (string)Application.Current.FindResource("str_Notuninstalled");
                str_Error = (string)Application.Current.FindResource("str_Error");
                str_cause = (string)Application.Current.FindResource("str_Cause");
                str_connectingviawpc = (string)Application.Current.FindResource("str_Connectingviawpc");
                str_wpconnectwontlaunch = (string)Application.Current.FindResource("str_Wpconnectwontlaunch");
                str_wpconnectnotconnected = (string)Application.Current.FindResource("str_Wpconnectnotconnected");
                str_wpconnectconnected = (string)Application.Current.FindResource("str_Wpconnectconnected");
                str_waitingforwpc = (string)Application.Current.FindResource("str_Waitingforwpc");
                str_launchingwpc = (string)Application.Current.FindResource("str_Launchingwpc");
                str_wpconnectpathnotdefine = (string)Application.Current.FindResource("str_Wpconnectpathnotdefine");
                str_operationstopped = (string)Application.Current.FindResource("str_Operationstopped");
                str_usingapp = (string)Application.Current.FindResource("str_Usingapp");
                str_installfailed = (string)Application.Current.FindResource("str_Installfailed");
                str_notconnect = (string)Application.Current.FindResource("str_Notconnect");
            }
            catch (Exception e)
            {
                ShowStatusMessage(e.Message + "\n" + str_connecting);
            }

        }
    }
}
